<?php
/*
	红娘中心
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
if($_RQ['op']=='main'){
	$daytime = mktime(0,0,0,date('m'),date('d'),date('Y'));
	$return['applyset']=$this->plugin_setting('redapply');
	set_html('title',$return['setting']['title']?:'红娘中心');
	$basic=model('core/member')->basic($_SESSION['uid']);
	$member=array_merge($worker,$basic);
	$fuwutitle=$this->getcolumn('fuwu',array('id'=>$worker['fuwuid']),'title');
	$fuwutitle=$fuwutitle?:'无服务中心';
	$return['fuwutitle']=$fuwutitle;
	$member['url']=custom_url('/member.index//worker_id='.$worker['id'],true);
	$return['member']=$member;
	$data['dayordernum']=$this->count('worker_log',array('check_time >'=>$daytime,'uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid']),'id');
	$data['usernum']=$this->count('member',array('worker_id'=>$worker['id'],'uniacid'=>$_SESSION['uniacid']),'id');
	$data['dainum']=$this->count('worker_log',array('check_time'=>0,'uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid']),'id');
	$data['isnum']=$this->count('worker_log',array('check_time >'=>0,'uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid']),'id');
	exi($return);
}
if($_RQ['op']=='getnew'){
	$params=array(
		'status'=>0,
		'uniacid'=>$_SESSION['uniacid'],
		'worker_id'=>$worker['id'],
	);
	$this->session('isopenvoice',1);
	$order=pdo_get('jy_ailiao_worker_log',$params);
	if($order['id']){
		exi($order);
	}else{
		exi('none');
	}
}
if($_RQ['op']=='setopenvoice'){
	$isopenvoice=$_RQ['isopenvoice'];
	$isopenvoice=$isopenvoice?1:0;
	$this->session('isopenvoice',$isopenvoice);
	exi($return);
}
?>